package com.action.analyseAction;

import org.apache.struts.action.ActionForward;

import com.biz.sourceAndTargetbiz.SensitivityObjectBiz;

import base.Power;
import admin.mode.AdminMode;
import admin.mode.MemberDispatchAction;

public class SourceAndTargetAction extends MemberDispatchAction {
	SensitivityObjectBiz biz = new SensitivityObjectBiz();

	public ActionForward sensitivityObject(Power power, AdminMode admin)
			throws Exception {
		power.setAttribute("roleList", biz.getValue(power, admin));
		power.setAttribute("user", admin.getUserInfo());
		System.out.println(power.getParameter("operation"));
		return power.findForward("/page/analyse/findIndex.jsp", false);
	}

	public ActionForward sensitiveAction(Power power, AdminMode admin)
			throws Exception {
		power.setAttribute("user", admin.getUserInfo());
		System.out.println(power.getParameter("operation"));
		return power.findForward("/page/analyse/find.jsp", false);
	}

	public ActionForward resultAction(Power power, AdminMode admin)
			throws Exception {
		power.setAttribute("user", admin.getUserInfo());
		power.setAttribute("result", biz.getResult(power, admin));
		if (power.getParameter("type").equals("1")) {
			return power.findForward(null);
		} else {
			return power.findForward("/page/analyse/result.jsp", false);
		}
	}
}
